

import 'package:flutter/material.dart';
import 'package:flutter_yishop/utils/screen/ScreenAdapter.dart';
import 'package:webview_flutter/webview_flutter.dart';

class TabProductDetailsPage extends StatefulWidget{

  final List _productContentList;
  TabProductDetailsPage(this._productContentList,{Key key}) : super(key: key);

  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _TabProductDetailsPageState();
  }

}

class _TabProductDetailsPageState extends State<TabProductDetailsPage> with AutomaticKeepAliveClientMixin{

  var _id;
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    this._id=widget._productContentList[0].sId;
    var url = "http://jd.itying.com/pcontent?id=${ this._id}";
    print('url:$url');
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    ScreenAdapter.init(context);
    return Container(
      margin: EdgeInsets.only(bottom:ScreenAdapter.height(100) ),
      child: WebView(
        initialUrl: "http://jd.itying.com/pcontent?id=${ this._id}",
      ),
    );
  }

  @override
  // TODO: implement wantKeepAlive
  bool get wantKeepAlive => true;

}